<template>
  <a-modal
    title="请输入原因"
    :visible="setApproveReason"
    ok-text='确认审核'
    @ok="confirmReason"
    @cancel="approveCancel"
  >
    <a-textarea
      v-model="value"
      placeholder="请输入原因"
      :auto-size="{ minRows: 3, maxRows: 5 }"
    />
  </a-modal>
</template>

<script>

  export default {
    name: 'setReason',
    components: {},
    data() {
      return {
        value: '',
        setApproveReason: false
      }
    },
    created() {
    },
    computed: {},
    methods: {
      show() {
        this.value = ''
        this.setApproveReason = true
      },
      confirmReason() {
        if (this.value == null) {
          this.$message.error('请填写原因');
        } else {
          this.$emit('approveReason', this.value)
        }
      },
      approveCancel(e) {
        this.setApproveReason = false;
      },
    }
  }
</script>

<style scoped>

</style>
